-
Notifications
You must be signed in to change notification settings - Fork 3
Implement ElectricMultipoleParameters #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
6d57eb5 to
3313a3a
Compare
|
I was looking into duplicating most of the Is it expected that the pals-python/src/pals/kinds/Quadrupole.py Lines 7 to 15 in 2ddf2a7
Shouldn't a quadrupole be either electric or magnetic? |
|
@EZoni Here is my point of view: By far the most common usage of "Quadrupole" refers to a magnetic quadrupole, for which all the electric multipole contributions vanish. However, there has been a general trend to allow optional contributions from other parameter groups where reasonable (for example, to support different types of "combined-function" elements). There are also pure electric quadrupoles, for which the same situation applies in reverse (although these are less common). If we wanted to treat electric and magnetic quadrupoles in a symmetric way, there would be two options: 1) create a separate ElectricQuadrupole kind; or 2) require the specification of either magnetic or electric quadrupole components or both (e.g., at least one must be specified). Either option appears reasonable to me. |
|
Thanks, @cemitch99! The standard, https://pals-project.readthedocs.io/en/latest/element-kinds.html#quadrupole-element, seems to go more in the direction of your option 2, "require the specification of either magnetic or electric quadrupole components or both (e.g., at least one must be specified)", since it doesn't mention any I think I will propose a change that implements option 2 and see if it works for everyone. |
|
@EZoni That sounds good; I agree it's a simple and clean option. |
|
Do you think the same is true for Right now they seem to allow for no parameter at all, neither MagneticMultipoleP nor ElectricMultipoleP, i.e., both are optional. For example, we have this
without extra validation logic that requires at least one of the two to be present (like the logic I added in this PR for I could fix this in a separate PR, once the "under construction" flag is removed. Do you think this does need a fix indeed? |
|
@EZoni I plan to contribute Sextupole, Octupole, and Multipole sections to the standard shortly, since they are simple and widely used. I don't see any good argument for allowing these element kinds with no multipole components at all (since then they have no reason to be classified this way), so adding a validation doesn't hurt. In some ways, it is a bare minimum sanity check. |
| Valid parameter formats: | ||
| - tiltN: Tilt of Nth order multipole | ||
| - EnN: Normal component of Nth order multipole | ||
| - EsN: Skew component of Nth order multipole | ||
| - *NL: Length-integrated versions of components (e.g., En3L, EsNL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh interesting, is this a PALS defect that we have no normalized parameters for the ElectricMultipoleParameters?
https://pals-project.readthedocs.io/en/latest/element-parameters.html#electricmultipolep-electric-multipole-parameters
pals-python/src/pals/parameters/MagneticMultipoleParameters.py
Lines 33 to 34 in 35ed73a
| - KnN: Normalized normal component of Nth order multipole | |
| - KsN: Normalized skew component of Nth order multipole |
I would expect this to be identical as for the magnetic parameters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've never seen normalized electric field strengths used which is why I left them out. If someone actually does use them then they should be put in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, perfect! Thanks for checking David! 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. As a follow-up, please check if normalized is missing in the PALS standard for electric multipole params. Looks like an oversight/inconsistency to me.
Close #38.
To do:
ElectricMultipoleParameters.